package task;

public class Task6_11 {
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6};
        toString(array);
    }
    public static String toString(int[] array){
        if(array == null)return "null";
        String str = "";
        System.out.print(str + "[");
        for (int i = 0; i < array.length; i++) {
            if(i == array.length - 1){
                System.out.print(array[i]);
                break;
            }
            System.out.print(array[i] + ", ");
        }
        System.out.println(str + "]");
        return str;
    }

}
